# Group Session Type
Data related to all the session types (such as talks, workshops, lightning talks) associated with the event.

| Parameter | Description | Type | Required |
|:----------|-------------|------|----------|
| `name`  | Name of the Session Type | string | **yes** |
| `length` | Length of the Session Type | string | 00:30 |

## Session Type Collection [/v1/session-types{?page%5bsize%5d,page%5bnumber%5d,sort,filter}]
+ Parameters
    + page%5bsize%5d (optional, integer, `10`) - Maximum number of resources in a single paginated response.
    + page%5bnumber%5d (optional, integer, `2`) - Page number to fetched for the paginated response.
    + sort (optional, string, `name`) - Sort the resources according to the given attribute in ascending order. Append '-' to sort in descending order.
    + filter (optional, string, `[]`) - Filter according to the flask-rest-jsonapi filtering system. Please refer: http://flask-rest-jsonapi.readthedocs.io/en/latest/filtering.html for more.


### Create Session Type [POST]
Create a new session type using an event_id.

+ Request (application/vnd.api+json)

    + Headers

            Authorization: JWT <Auth Key>

    + Body

            {
              "data": {
                  "relationships":{
                      "event":{
                        "data":{
                          "type":"event",
                          "id":"1"
                        }
                      }
                    },
                    "attributes": {
                      "name": "Workshop",
                      "length": "00:30"
                    },
                    "type": "session-type"
              }
            }


+ Response 201 (application/vnd.api+json)

        {
          "data": {
            "relationships": {
              "event": {
                "links": {
                  "self": "/v1/session-types/1/relationships/event",
                  "related": "/v1/session-types/1/event"
                }
              },
              "sessions": {
                "links": {
                  "self": "/v1/session-types/1/relationships/sessions",
                  "related": "/v1/session-types/1/sessions"
                }
              }
            },
            "attributes": {
              "name": "Workshop",
              "length": "00:30",
              "deleted-at": null
            },
            "type": "session-type",
            "id": "1",
            "links": {
              "self": "/v1/session-types/1"
            }
          },
          "jsonapi": {
            "version": "1.0"
          },
          "links": {
            "self": "/v1/session-types/1"
          }
        }


## Session Type Details [/v1/session-types/{session_type_id}]
+ Parameters
    + session_type_id: 1 (integer) - ID of the session_type in the form of an integer

### Session Type Details [GET]
Get a single session type.

+ Request

    + Headers

            Accept: application/vnd.api+json

            Authorization: JWT <Auth Key>

+ Response 200 (application/vnd.api+json)

        {
          "data": {
            "relationships": {
              "event": {
                "links": {
                  "self": "/v1/session-types/1/relationships/event",
                  "related": "/v1/session-types/1/event"
                }
              },
              "sessions": {
                "links": {
                  "self": "/v1/session-types/1/relationships/sessions",
                  "related": "/v1/session-types/1/sessions"
                }
              }
            },
            "attributes": {
              "name": "Workshop",
              "deleted-at": null,
              "length": "00:30"
            },
            "type": "session-type",
            "id": "1",
            "links": {
              "self": "/v1/session-types/1"
            }
          },
          "jsonapi": {
            "version": "1.0"
          },
          "links": {
            "self": "/v1/session-types/1"
          }
        }


### Update Session Type [PATCH]
Update a single session type by `id`.

+ `id` (integer) - ID of the record to update **(required)**

+ Request (application/vnd.api+json)

    + Headers

            Authorization: JWT <Auth Key>

    + Body

            {
              "data": {
                "attributes": {
                  "name": "Workshop 2",
                  "length": "01:30"
                },
                "type": "session-type",
                "id": "1"
              }
            }

+ Response 200 (application/vnd.api+json)

        {
          "data": {
            "relationships": {
              "event": {
                "links": {
                  "self": "/v1/session-types/1/relationships/event",
                  "related": "/v1/session-types/1/event"
                }
              },
              "sessions": {
                "links": {
                  "self": "/v1/session-types/1/relationships/sessions",
                  "related": "/v1/session-types/1/sessions"
                }
              }
            },
            "attributes": {
              "name": "Workshop 2",
              "deleted-at": null,
              "length": "01:30"
            },
            "type": "session-type",
            "id": "1",
            "links": {
              "self": "/v1/session-types/1"
            }
          },
          "jsonapi": {
            "version": "1.0"
          },
          "links": {
            "self": "/v1/session-types/1"
          }
        }

### Delete Session Type [DELETE]
Delete a single session type.

+ Request

    + Headers

            Accept: application/vnd.api+json

            Authorization: JWT <Auth Key>

+ Response 200 (application/vnd.api+json)

        {
          "meta": {
            "message": "Object successfully deleted"
          },
          "jsonapi": {
            "version": "1.0"
          }
        }


## List Session Types under an Event [/v1/events/{event_identifier}/session-types{?page%5bsize%5d,page%5bnumber%5d,sort,filter}]
+ Parameters
    + event_identifier: 1 (string) - identifier or event id of the event. (b8324ae2 is an example of identifier)
    + page%5bsize%5d (optional, integer, `10`) - Maximum number of resources in a single paginated response.
    + page%5bnumber%5d (optional, integer, `2`) - Page number to fetched for the paginated response.
    + sort (optional, string, `name`) - Sort the resources according to the given attribute in ascending order. Append '-' to sort in descending order.
    + filter (optional, string, `[]`) - Filter according to the flask-rest-jsonapi filtering system. Please refer: http://flask-rest-jsonapi.readthedocs.io/en/latest/filtering.html for more.


### List Session Types [GET]


+ Request

    + Headers

            Accept: application/vnd.api+json

            Authorization: JWT <Auth Key>

+ Response 200 (application/vnd.api+json)


        {
            "meta": {
                "count": 1
            },
            "data": [
                {
                    "relationships": {
                        "event": {
                            "links": {
                                "self": "/v1/session-types/1/relationships/event",
                                "related": "/v1/session-types/1/event"
                            }
                        },
                        "sessions": {
                            "links": {
                                "self": "/v1/session-types/1/relationships/sessions",
                                "related": "/v1/session-types/1/sessions"
                            }
                        }
                    },
                    "attributes": {
                        "length": "00:30",
                        "deleted-at": null,
                        "name": "Workshop"
                    },
                    "type": "session-type",
                    "id": "1",
                    "links": {
                        "self": "/v1/session-types/1"
                    }
                }
            ],
            "jsonapi": {
                "version": "1.0"
            },
            "links": {
                "self": "/v1/events/1/session-types"
            }
        }


## Get Session Type of a Session [/v1/sessions/{session_id}/session-type]
+ Parameters
    + session_id: 1 (integer) - ID of the session in the form of an integer

### Get Session Type Details [GET]
Get a single session type.

+ Request

    + Headers

            Accept: application/vnd.api+json

            Authorization: JWT <Auth Key>


+ Response 200 (application/vnd.api+json)


        {
            "data": {
                "relationships": {
                    "event": {
                        "links": {
                            "self": "/v1/session-types/1/relationships/event",
                            "related": "/v1/session-types/1/event"
                        }
                    },
                    "sessions": {
                        "links": {
                            "self": "/v1/session-types/1/relationships/sessions",
                            "related": "/v1/session-types/1/sessions"
                        }
                    }
                },
                "attributes": {
                    "length": "00:30",
                    "deleted-at": null,
                    "name": "Workshop"
                },
                "type": "session-type",
                "id": "1",
                "links": {
                    "self": "/v1/session-types/1"
                }
            },
            "jsonapi": {
                "version": "1.0"
            },
            "links": {
                "self": "/v1/session-types/1"
            }
        }
